import { defineStore } from 'pinia'

export const useRouteStore = defineStore('routecache', {
  state: () => ({
    lang: 'zh_CN',
    keepAliveViews: [],
    notKeepAliveViews: []
  }),
  actions: {
    setKeepAliveViews (data) {
      this.keepAliveViews = data
    },
    setNotKeepAliveViews (data) {
      this.notKeepAliveViews = data
    }
  },
  persist: {
    // 保存的位置
    enabled: true,
    storage: sessionStorage // localstorage
  }
})
